<?php
/*
 * Form - Quá trình học vấn
 */
?>
<style>
    .modal {
        width: 727px;
        margin:-250px 0 0 -346px;
    }
    .modal-body {
        max-height: 482px;
        overflow-y: auto;
        padding: 15px;
    }
</style>
<?php
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'quatrinhhocvan-form',
    'type' => 'horizontal',
    'action'=> Yii::app()->getBaseUrl(true).'/ungvien/tintimviec/'. ($hid != '' && $qid != '') ? '?id='.$hid.'&qid='.$qid.'#step2' : '',
    'enableClientValidation' => true,
    'clientOptions' => array(
        'validateOnSubmit' => true,
    ),
  ));
?>
<legend id='step2' class='title-field title-jobs mt_20'><i class='icon icon-plus-sign mt_5 icon-white'></i> Quá trình học vấn</legend>
<div class='info-job'>

    <?php echo $form->textFieldRow($model, 'truong_khoahoc', array('class' => 'span4')); ?>
    <?php echo $form->textFieldRow($model, 'thanhpho', array('class' => 'span4')); ?>
    <?php echo $form->textFieldRow($model, 'quocgia', array('class' => 'span4')); ?>
    <?php echo $form->dropDownListRow($model, 'bangcap_id', CHtml::listData(Bangcap::model()->findAllByAttributes(array('published' => 1)), 'id', 'name'), array('prompt' => '- Chọn -', 'class' => 'span4')); ?>
    <div class='div-row'>
        <label class='w150'>Thời gian tốt nghiệp:</label>
        <p class='nn-row' style='margin-top:-3px;'>
            Tháng: <input type='text' name='Quatrinhhocvan[thang]' value='<?php echo $model->totnghiep_thang; ?>' class='span1 ar' onkeyup="BlockChar(this,'NotNumbers')" />
            Năm: <input type='text' name='Quatrinhhocvan[nam]' value='<?php echo $model->totnghiep_nam; ?>' class='span1 ar' onkeyup="BlockChar(this,'NotNumbers')" />
        </p> 
    </div>
    <?php echo $form->textAreaRow($model, 'tomtat', array('class' => 'span7 clearfix')); ?>
    <div class='control-group showsub count'>
        (Mục tiêu nghề nghiệp không được quá <input id='ktt' value='2000' class='span1' /> kí tự)
    </div>
    <div class='div-row'>
        <label class='mt w150'>&nbsp;</label>
        <p class='nn-row'>
            <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? 'Thêm' : 'Cập nhật', 'icon' => 'icon-refresh icon-white','htmlOptions' => array('id' => 'btn-action'))); ?>
            <?php $this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'reset', 'type' => 'primary', 'label' => 'Bỏ qua', 'icon' => 'icon-remove-sign icon-white', 'htmlOptions' => array('class' => 'close-form'))); ?>
        </p> 
    </div>

    <div class='clearfix'></div>
</div>
<?php $this->endWidget(); ?>
<script>
    $(document).ready(function(){
        $('.modal-footer').remove();
        /* tom tat qua trinh hoc */
        $('#Quatrinhhocvan_tomtat').keyup(function(){
            var mtss = $(this).val();
            if(mtss.length > 2000){
                alert('Nhập không quá 2000 từ');
                var a = mtss.substr(0,2000);
                $('#ktt').val(a);
                return false;
            }else{
                $('#ktt').val(2000-mtss.length);
            }
        });   
      $('#quatrinhhocvan-form').yiiactiveform({'validateOnSubmit':true,'attributes':[{'id':'Quatrinhhocvan_truong_khoahoc','inputID':'Quatrinhhocvan_truong_khoahoc','errorID':'Quatrinhhocvan_truong_khoahoc_em_','model':'Quatrinhhocvan','name':'Quatrinhhocvan[truong_khoahoc]','enableAjaxValidation':false,'inputContainer':'div.control-group','status':1,'clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("Tr\u01b0\u1eddng \/ Kh\u00f3a h\u1ecdc kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>45) {
	messages.push("Tr\u01b0\u1eddng \/ Kh\u00f3a h\u1ecdc qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 45 k\u00ed t\u1ef1).");
}

}

}},{'id':'Quatrinhhocvan_thanhpho','inputID':'Quatrinhhocvan_thanhpho','errorID':'Quatrinhhocvan_thanhpho_em_','model':'Quatrinhhocvan','name':'Quatrinhhocvan[thanhpho]','enableAjaxValidation':false,'inputContainer':'div.control-group','status':1,'clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("Th\u00e0nh ph\u1ed1 kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>100) {
	messages.push("Th\u00e0nh ph\u1ed1 qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 100 k\u00ed t\u1ef1).");
}

}

}},{'id':'Quatrinhhocvan_quocgia','inputID':'Quatrinhhocvan_quocgia','errorID':'Quatrinhhocvan_quocgia_em_','model':'Quatrinhhocvan','name':'Quatrinhhocvan[quocgia]','enableAjaxValidation':false,'inputContainer':'div.control-group','status':1,'clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("Qu\u1ed1c gia kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(value.length>45) {
	messages.push("Qu\u1ed1c gia qu\u00e1 d\u00e0i (t\u1ed1i \u0111a l\u00e0 45 k\u00ed t\u1ef1).");
}

}

}},{'id':'Quatrinhhocvan_bangcap_id','inputID':'Quatrinhhocvan_bangcap_id','errorID':'Quatrinhhocvan_bangcap_id_em_','model':'Quatrinhhocvan','name':'Quatrinhhocvan[bangcap_id]','enableAjaxValidation':false,'inputContainer':'div.control-group','status':1,'clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("B\u1eb1ng c\u1ea5p kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}


if($.trim(value)!='') {
	
if(!value.match(/^\s*[+-]?\d+\s*$/)) {
	messages.push("B\u1eb1ng c\u1ea5p ph\u1ea3i l\u00e0 s\u1ed1 nguy\u00ean.");
}

}

}},{'id':'Quatrinhhocvan_tomtat','inputID':'Quatrinhhocvan_tomtat','errorID':'Quatrinhhocvan_tomtat_em_','model':'Quatrinhhocvan','name':'Quatrinhhocvan[tomtat]','enableAjaxValidation':false,'inputContainer':'div.control-group','status':1,'clientValidation':function(value, messages, attribute) {

if($.trim(value)=='') {
	messages.push("T\u00f3m t\u1eaft kh\u00f4ng \u0111\u01b0\u1ee3c ph\u00e9p r\u1ed7ng.");
}

}}]});
    });//end ready
</script>